package com.dayuanit.spring.demo.entity;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component("person")
public class Perosn {
    private String usrename;
    private int age;
    private Dog dog;

    public Perosn() {
        System.out.println("Person()");
    }

    public Perosn(String username) {
        this.usrename = username;
        System.out.println("Person(String)");
    }


    @Override
    public String toString() {
        return "Perosn{" +
                "usrename='" + usrename + '\'' +
                ", age=" + age +
                '}';
    }

    @Autowired
    public void setDog(Dog dog) {
        this.dog = dog;
    }

    public Dog getDog() {
        return dog;
    }

    public String getUsrename() {
        return usrename;
    }

    public void setUsrename(String usrename) {
        this.usrename = usrename;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
